const path = require('path');
const Koa = require('koa');
const Router = require('koa-router');
const serve = require('koa-static');
const { PeerServer } = require("peer");
const app = new Koa()
const router = new Router();
const rootPath = path.join(__dirname, '../web');
// 配置静态文件目录
app.use(serve(rootPath));
// 应用路由
app.use(router.routes()).use(router.allowedMethods());
const peerServer = PeerServer({ port: 9998, path: "/web_tv" });
// 启动服务器
const PORT = 9999;
app.listen(PORT, () => {
    console.log(`Server running on port ${PORT}`);
});
